Add @DeleteDateColumn() to the entity — TypeORM automatically excludes soft-deleted records from all queries when this column is present. Use softDelete() to set the timestamp, delete() to hard delete, restore() to recover, and { withDeleted: true } in find options to include soft-deleted records.
@DeleteDateColumn() activates TypeORM's built-in soft delete support — no manual WHERE clause needed.
All standard find() queries automatically exclude soft-deleted records when @DeleteDateColumn is present.
softDelete() sets the timestamp; delete() permanently removes the row.
restore() clears the deletedAt timestamp, making the record visible again in standard queries.
Use withDeleted: true in find options when you need to include or operate on soft-deleted records.